#include "LayerManager.h"

#include "LayerHomeTop.h"
#include "LayerHomeMiddle.h"
#include "LayerHomeDown.h"
#include "LayerContainerPack.h"
#include "LayerContainerBody.h"
#include "LayerGroup.h"
#include "LayerSkill.h"
#include "LayerUserInfo.h"

#include "LayerCUnEvent.h"

CLayerManager::CLayerManager(void)
{
	initCommonLayer();
}


CLayerManager::~CLayerManager(void)
{
}

cocos2d::Node* CLayerManager::GetLayer(LayerIndex index) {
	switch (index)
	{
	case CLayerManager::LayerIHomeTop:
		return CLayerHomeTop::create();
		break;
	case CLayerManager::LayerIHomeDown:
		return CLayerHomeDown::create();
		break;
	case CLayerManager::LayerIHomeMiddle:
		return CLayerHomeMiddle::create();
		break;
	case LayerIContainerPack:
		return CLayerContainerPack::create();
		break;
	case LayerIContainerBody:
		return CLayerContainerBody::create();
		break;
	case LayerIGroup:
		return CLayerGroup::create();
		break;
	case LayerISkill:
		return CLayerSkill::create();
		break;
	case LayerIUserInfo:
		return CLayerUserInfo::create();
		break;
	default:
		break;
	}

	assert(false);
	return nullptr;
}

void CLayerManager::initCommonLayer() {
	auto tNode = CLayerCUnEvent::create();
	tNode->retain();
	m_CommonLayer[CommonUnEventLayer] = tNode;
}
